$().ready(function() {

    jQuery("#<?php echo $this->getModuleName() ?>-grid").jqGrid({        
            url:'[?php echo url_for('<?php echo str_replace('_index', '', $this->getUrlForAction('index')) ?>') . '.xml' ?]',
            datatype: "xml",
            colNames:[
                <?php foreach ($this->configuration->getValue('list.display') as $name => $field): ?>
                    <?php if ($field->isReal()): ?>
                        [?php if ('<?php echo $name ?>' == $sort[0]): ?]
                            '[?php echo __('<?php echo $field->getConfig('label', '', true) ?>') ?]',
                        [?php else: ?]
                            '[?php echo __('<?php echo $field->getConfig('label', '', true) ?>') ?]',
                        [?php endif; ?]
                    <?php else: ?>
                        '[?php echo __('<?php echo $field->getConfig('label', '', true) ?>') ?]',
                    <?php endif; ?>
                <?php endforeach; ?>
                '[?php echo __('Aktionen') ?]'
            ],
            colModel:[
                <?php foreach ($this->configuration->getValue('list.display') as $name => $field): ?>
                    {name:'<?php echo $field->getName() ?>',index:'<?php echo $field->getName() ?>'},
                <?php endforeach; ?>
                {name:'actions',index:'actions', width:55, sortable: false}    
            ],
   	rowNum:10,
   	pager: '#<?php echo $this->getModuleName() ?>-grid-bar',
   	sortname: 'id',
        viewrecords: true,
        autowidth: true,
        sortorder: "asc",
        caption:""
    });
    
});

<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
